package sales.gz.com.salescounter.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import sales.gz.com.salescounter.R;
import sales.gz.com.salescounter.utils.N01_Dev_YM;

public class PayStatusActivity extends Activity {

    @Bind(R.id.tx_title)
    TextView title;
    private N01_Dev_YM milk_ctrl_dev;
    private String box_no;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_paystatus);
        ButterKnife.bind(this);
        box_no = getIntent().getStringExtra("box_no");
        initview();
    }

    private void initview() {
        title.setText("支付成功");
        milk_ctrl_dev = new N01_Dev_YM("dev/ttyO2");
        milk_ctrl_dev.Start(Integer.parseInt(box_no.substring(0,1)),Integer.parseInt(box_no.substring(1,2)));
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(PayStatusActivity.this,MainActivity.class);
                startActivity(intent);
                System.exit(0);
            }
        }, 3000);
    }


}
